Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add libtor exiting logic #6782

Merged
merged 3 commits into from
Feb 5, 2025

Conversation

hansieodendaal
Copy link
Contributor

@hansieodendaal hansieodendaal commented Feb 4, 2025

Description

The base node and console wallet have various immediate exit paths through 'process::exit', as well as controlled exit via user/shutdown command.

  • This implementation uses a unique but predictable handshake file containing the libtor temporary directory for each base node or console wallet running instance to cover all exit paths. When the main thread exits, via user command or 'process::exit', the libtor temporary files and the handshake file are removed. does away with the temporary libtor data folder and log file and instead uses a fixed or user-controllable location via the --libtor-data-dir command line option.

  • Added libtor exiting logic to:

    • log any shutdown errors;
    • remove temporary files.
  • Added a failsafe timeout for test-liveness.

Closes #6739 and #6741

Motivation and Context

See #6739 and #6741

How Has This Been Tested?

System-level testing:

  • Base node (Ubuntu), executing test liveness from the command line, with and without using libtor
./minotari_node --base-path $(realpath .) --log-config $(realpath ./config)/log4rs_node.yml --network esmeralda --disable-splash-screen -p esmeralda.p2p.seeds.dns_seeds= -p esmeralda.p2p.seeds.peer_seeds= --watch "test-peer-liveness f6186e6f15af070d01d5aec8c5a53d81088c34b777cd0b25292d1cd522532462 /onion3/5uqpxi6ando6jrtcpj3aok4z7ab2nm36knfv2pzdf2hefdpkdcjnazid:18141 true true false" --non-interactive-mode -p base_node.use_libtor=true
  • Base node (Ubuntu), with console, using libtor
  • Console wallet (Ubuntu), with console, using libtor
  • Console wallet (Ubuntu), recovery into console, using libtor

What process can a PR reviewer use to test or verify this change?

System-level testing
Code review

Breaking Changes

  • None
  • Requires data directory on base node to be deleted
  • Requires hard fork
  • Other - Please specify

Added libtor exiting logic to:
- log any shutdown errors
- remove temporary files
- added a failsafe timeout for test-liveness
Copy link

github-actions bot commented Feb 4, 2025

Test Results (CI)

    3 files    129 suites   35m 28s ⏱️
1 360 tests 1 360 ✅ 0 💤 0 ❌
4 078 runs  4 078 ✅ 0 💤 0 ❌

Results for commit b6e029b.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Feb 4, 2025

Test Results (Integration tests)

 2 files  + 2  11 suites  +11   53m 53s ⏱️ + 53m 53s
36 tests +36  34 ✅ +34  0 💤 ±0  2 ❌ +2 
39 runs  +39  35 ✅ +35  0 💤 ±0  4 ❌ +4 

For more details on these failures, see this check.

Results for commit b6e029b. ± Comparison against base commit f5365ca.

♻️ This comment has been updated with latest results.

sdbondi
sdbondi previously approved these changes Feb 5, 2025
Copy link
Member

@sdbondi sdbondi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@SWvheerden SWvheerden merged commit eeee441 into tari-project:development Feb 5, 2025
17 of 18 checks passed
@hansieodendaal hansieodendaal deleted the ho_libtor branch February 5, 2025 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

base node libtor does not clean up temporary files on exit
3 participants